<template>
  <div>
    <el-dialog
      width="45%"
      title="新增工单"
      :visible="$store.state.dialog.addDialog"
      :before-close="holderColse"
    >
      <el-form ref="form" :model="form" label-width="80px" :rules="rules">
        <el-form-item label="设备标号" prop="name">
          <el-input
            v-model="Object.keys($store.state.dialog.row).length !== 0 ? $store.state.dialog.row.innerCode : form.name "
          ></el-input>
        </el-form-item>
        <el-form-item label="工单类型" prop="region">
          <el-select v-model="form.region" placeholder="请选择活动区域">
            <el-option :label="form.region" value="补货工单"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="补货数量">
          <a href="#" @click="huFn">
            <i class="el-icon-s-order"></i>
            {{Object.keys($store.state.dialog.row).length !== 0 ? '补货详情':'补货清单'}}
          </a>
        </el-form-item>
        <el-form-item label="运营人员" prop="gion">
          <el-select v-model="form.gion" placeholder="请选择活动区域">
            <!-- <template v-for="item in $store.state.dialog.perpoe"> -->
            <el-option v-for="item in $store.state.dialog.perpoe" :label="form.gion" :value="item"></el-option>
            <!-- </template> -->
          </el-select>
        </el-form-item>
        <el-form-item label="备注" prop="desc" placeholder="请输入备注(不超过40字)">
          <el-input type="textarea" v-model="form.desc"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="onSubmit">确认</el-button>
          <el-button @click="holderColse">取消</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
    <BhDialog>
    </BhDialog>
  </div>
</template>

<script>
import { getMent } from '@/api/oder'
export default {
  name: 'addDialog',
  props: {},
  data() {
    return {
      form: {},
      rules: {
        innerCode: [{ required: true, message: '必须填写', trigger: 'blur' }],
        region: [{ required: true, message: '必须填写', trigger: 'blur' }],
        gion: [{ required: true, message: '必须填写', trigger: 'blur' }],
        desc: [{ required: true, message: '必须填写', trigger: 'blur' }],
      },
      list: {},
    }
  },
  components: {},
  methods: {
    // 补货清单
    async huFn() {
      if(this.$store.state.dialog.XqDialog && this.$store.state.dialog.addDialog) {
        this.$store.state.dialog.buman = true
      }
      this.$store.commit('dialog/updateBhDialog', true)
      console.log(1)
    },
    //关闭弹框
    holderColse() {
      this.$store.commit('dialog/updateAddDialog', false)
      this.$refs.form.resetFields()
    },
    onSubmit() {},
  },
  computed: {},
  mounted() {
  },
  watch: {},
}
</script>

<style scoped lang="less">
</style>
